package com.example.asus.practice;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.RatingBar;
import android.widget.Toast;

public class Ratingbar extends AppCompatActivity {
    RatingBar ratingBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ratingbar);
        ratingBar = (RatingBar)findViewById(R.id.ratingBar);
        String rating = String.valueOf(ratingBar.getRating());
        Toast.makeText(this, rating + "颗星", Toast.LENGTH_SHORT).show();
        String stepSize = String .valueOf(ratingBar.getStepSize());
        Toast.makeText(this, "StepSize:"+ stepSize, Toast.LENGTH_SHORT).show();
        String progress = String .valueOf(ratingBar.getProgress());
        Toast.makeText(this, "progress:" + progress, Toast.LENGTH_SHORT).show();
    }
}
